package com.thd.filter;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.gateway.filter.GatewayFilter;
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

public class KeyValueGatewayFilter implements GatewayFilter{
    Logger logger = LoggerFactory.getLogger(CustomerGatewayFilter.class.getName());

    private String name;
    private String value;
    public KeyValueGatewayFilter(String name, String value){
        this.name = name;
        this.value= value;
    }
    @Override
    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
        logger.info("keyValue的过滤器：{},{}====================", this.name,this.value);

        return chain.filter(exchange);
    }

    /**
     * 值越小，优先级越高
     *
     * @return
     */

}

